<template>
    <div class="view1">
        <div :class="[selected ? 'leftCome' : 'leftLeave']"></div>
        <div :class="[selected ? 'rightCome' : 'rightLeave']"></div>
    </div>
</template>

<script>
export default {
    name: "view1",
    data() {
        return {
            selected: this.$route.meta.selected
        }
    },
    created() {
        console.log(this.$route.meta.selected);
    }
}
</script>

<style scoped>
.view1 {
    flex: 1;
    display: flex;
}
.view1 div {
    flex: 1;
}
.view1 div:nth-of-type(1) {
    background-color: red;
}
.view1 div:nth-of-type(2) {
    background-color: green;
}
</style>